{% extends "admin/master.volt" %}
{% block content %}
    <header class="bar bar-nav">
        <h1 class="title">学生列表</h1>
        <a class="button pull-right external" href="{{ url('/admin/index/add') }}">
            新增
        </a>
        <a class="button pull-right external" href="{{ url('/admin/index/index/'~type) }}">
            切换
        </a>
    </header>
    {% if(type==0) %}
        <div class="content">
            <div class="list-block media-list">
                <ul>
                    {% for item in student %}
                        <li onclick="toEdit({{ item.id }})">
                            <div class="item-content">
                                <div class="item-media">
                                    <img src="{{ static_url(item.avatar) }}"
                                         style='width: 2.2rem;'></div>
                                <div class="item-inner">
                                    <div class="item-title-row">
                                        <div class="item-title">{{ item.name }}</div>
                                    </div>
                                    <div class="item-subtitle">{{ item.cert }}</div>
                                </div>
                            </div>
                        </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
    {% else %}
        <div class="content">
            <div class="row">
                {% for item in student %}
                    <div class="col-50">
                        <img src="{{ static_url('/uploads/qrcode/'~item.id~'.png') }}" style="width: 100%" alt="">
                    </div>
                {% endfor %}
            </div>
        </div>
    {% endif %}
{% endblock %}

